#!/usr/bin/env python
#coding=utf-8
from sqlalchemy import or_ ,and_
from Applications.extensions import db
from .BaseModel import baseModel


class linksModel(baseModel):
	__tablename__ = 'home_links'

	link_id = db.Column(db.Integer,primary_key=True, nullable=False, comment='ID')
	link_name = db.Column(db.String(255), nullable=False, comment='连接名')
	link_url = db.Column(db.String(2000), nullable=False, comment='URL')
	link_imge = db.Column(db.String(2000), nullable=False, comment='主图')
	link_path = db.Column(db.String(255), nullable=False, comment='扩展路径')
	link_admin = db.Column(db.String(255), nullable=False, comment='权限')
	link_classId = db.Column(db.Integer, nullable=False, comment='分类')
	link_className = db.Column(db.String(255), nullable=False, comment='分类名')
	link_order = db.Column(db.Integer, nullable=False, comment='菜单名')
	link_style = db.Column(db.String(5000), nullable=False, comment='样式')




	@classmethod
	def get_all(cls):
		list = cls.query.filter(cls.link_admin == 'public').all()
		return list